
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-18
**/
@Entity
@Data
@Table(name="app_message_to")
public class AppMessageTo implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "ID")
    private Integer id;

    @Column(name = "user_id")
    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @Column(name = "nick_name")
    @ApiModelProperty(value = "用户昵称")
    private String nickName;

    @Column(name = "msg_id")
    @ApiModelProperty(value = "消息ID")
    private Integer msgId;

    @Column(name = "read_time")
    @ApiModelProperty(value = "读取时间")
    private Timestamp readTime;

    @Column(name = "status")
    @ApiModelProperty(value = "状态")
    private Integer status;

    @Column(name = "create_time")
    @ApiModelProperty(value = "createTime")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "updateTime")
    private Timestamp updateTime;

    public void copy(AppMessageTo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}